package cn.wolfcode.transfer.util;

public enum BusinessConsumptionUtil {
    门店("门店","b.`name`",1),
    年("年","YEAR(c.pay_time)",2),
    月("月","DATE_FORMAT(c.pay_time,'%Y-%m')",3),
    日("日","DATE_FORMAT(c.pay_time,'%Y-%m-%d')",4)
    ;
    private String name;
    private String value;
    private Integer number;

    BusinessConsumptionUtil(String name, String value,Integer number) {
        this.name = name;
        this.value = value;
        this.number = number;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getValue() {
        return value;
    }

    public Integer getNumber() {
        return number;
    }

    public void setNumber(Integer number) {
        this.number = number;
    }

    public void setValue(String value) {
        this.value = value;
    }
    public static String forBusinessConsumptionValue(Integer number){
        BusinessConsumptionUtil[] values = BusinessConsumptionUtil.values();
        for (BusinessConsumptionUtil value:values){
            if (value.number==(number)){
                return value.value;
            }
        }
        return null;
    }
}

